<div ng-controller="fullReductionCtrl">
    <div class="bg-light lter b-b wrapper-md ng-scope">
        <h4 class="m-n font-thin">满减送</h4>
    </div>
    <div class="wrapper-md">
        <div class="panel-body panel m-n">
            <div>
                <div class="b-a m-b-sm padder-v">
                    <div class="col-sm-9">
                        <form class="form-inline">
                            <div class="form-group m-t-sm">
                                <label class="control-label">活动开始时间</label>

                                <div class="input-group" ng-controller="DatepickerDemoCtrl">
                                    <div class="input-group  no-padder m-n w-lg">
                                        <input type="text" class="input-sm form-control"
                                               placeholder="请输入开始日期"
                                               uib-datepicker-popup="yyyy-MM-dd"
                                               datepicker-popup="yyyy-MM-dd"
                                               ng-model="fullReductionListVO.startTime"
                                               alt-input-formats="altInputFormats" is-open="opened"
                                               datepicker-options="dateOptions" close-text="关闭"
                                               clear-text="清空"
                                               current-text="今天"/>
                                        <span class="input-group-btn ">
                                            <button type="button" class="input-sm btn btn-default"
                                                    ng-click="open($event)">
                                                <i class="glyphicon glyphicon-calendar"></i></button>
                                        </span>
                                    </div>
                                </div>
                                <div class="input-group" ng-controller="DatepickerDemoCtrl">
                                    <div class="input-group  no-padder m-n w-lg">
                                        <input type="text" class="input-sm form-control"
                                               placeholder="请输入结束日期"
                                               uib-datepicker-popup="yyyy-MM-dd"
                                               datepicker-popup="yyyy-MM-dd"
                                               ng-model="fullReductionListVO.endTime"
                                               alt-input-formats="altInputFormats" is-open="opened"
                                               datepicker-options="dateOptions" close-text="关闭"
                                               clear-text="清空"
                                               current-text="今天"/>
                                        <span class="input-group-btn ">
                                            <button type="button" class="input-sm btn btn-default"
                                                    ng-click="open($event)">
                                                <i class="glyphicon glyphicon-calendar"></i></button>
                                        </span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group m-t-sm">
                                <label class="control-label">活动名称</label>
                                <input type="text" class="input-sm form-control"
                                       ng-model="fullReductionListVO.name"
                                       placeholder="活动的名称">
                            </div>
                            <button class="btn btn-sm btn-info" ng-click="findAll()">查询</button>
                        </form>
                    </div>
                    <div class="pull-right">
                        <a class="btn btn-sm btn-info" ui-sref="app.fullReductionAdd">新建满减满送</a>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
            <tabset class="tab-container">
                <tab heading="所有促销" ng-click="changeStatus(-1)">
                    <div class="panel-body no-padder">
                        <div class="table-responsive pos-rlt">
                            <table class="table table-striped b-t b-light pos-rlt m-n">
                                <thead>
                                <tr>
                                    <th>活动名称</th>
                                    <th>有限时间</th>
                                    <th>活动状态</th>
                                    <th>订单实付金额
                                        <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6"
                                           popover-placement="right" popover="满减送活动带来的总付款金额（包含退款）"
                                           popover-trigger="mouseenter"></i>
                                    </th>
                                    <th>付款订单数
                                        <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6"
                                           popover-placement="right" popover="参加满减送活动成功付款的订单数量"
                                           popover-trigger="mouseenter"></i>
                                    </th>
                                    <th>付款人数
                                        <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6"
                                           popover-placement="right" popover="参加满减送活动，成功付款的客户数"
                                           popover-trigger="mouseenter"></i>
                                    </th>
                                    <th width="200">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-if="list.length>0" ng-repeat="item in list" ng-init="initSelect()">
                                    <td>{{item.name}}</td>
                                    <td>{{item.startTime}}至{{item.endTime}}</td>
                                    <td>
                                        <span class="label bg-light dk"
                                              ng-class="{0:'bg-light',1:'bg-success',2:'bg-danger'}[item.status]"
                                              ng-bind="{0:'未开始',1:'进行中',2:'已结束'}[item.status]"></span>
                                    </td>
                                    <td>{{item.totalPayMoney}}</td>
                                    <td>{{item.totalOrdersCount}}</td>
                                    <td>{{item.totalPayUserCount}}</td>
                                    <td>
                                        <a class="btn btn-sm btn-info" ui-sref="app.fullReductionEdit({id:item.id})">编辑</a>
                                        <button class="btn btn-sm btn-danger" ng-click="fullReductionDelete(item.id,item.name)">删除</button>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                            <div ng-if="list.length<=0 && !app.loading" class="padder-v text-center">
                                <span class="h6">~未搜索到任何数据~</span>
                            </div>
                            <div>
                                <circle-loading ng-if="app.loading"></circle-loading>
                            </div>
                        </div>
                    </div>
                </tab>
                <tab heading="未开始" ng-click="changeStatus(0)">
                    <div class="panel-body no-padder">
                        <div class="table-responsive pos-rlt">
                            <table class="table table-striped b-t b-light pos-rlt">
                                <thead>
                                <tr>
                                    <th>活动名称</th>
                                    <th>有限时间</th>
                                    <th>活动状态</th>
                                    <th>订单实付金额
                                        <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6"
                                           popover-placement="right" popover="满减送活动带来的总付款金额（包含退款）"
                                           popover-trigger="mouseenter"></i>
                                    </th>
                                    <th>付款订单数
                                        <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6"
                                           popover-placement="right" popover="参加满减送活动成功付款的订单数量"
                                           popover-trigger="mouseenter"></i>
                                    </th>
                                    <th>付款人数
                                        <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6"
                                           popover-placement="right" popover="参加满减送活动，成功付款的客户数"
                                           popover-trigger="mouseenter"></i>
                                    </th>
                                    <th width="200">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-if="list.length>0" ng-repeat="item in list" ng-init="initSelect()">
                                    <td>{{item.name}}</td>
                                    <td>{{item.startTime}}至{{item.endTime}}</td>
                                    <td>
                                        <span class="label bg-light dk"
                                              ng-class="{0:'bg-light',1:'bg-success',2:'bg-danger'}[item.status]"
                                              ng-bind="{0:'未开始',1:'进行中',2:'已结束'}[item.status]"></span>
                                    </td>
                                    <td>{{item.totalPayMoney}}</td>
                                    <td>{{item.totalOrdersCount}}</td>
                                    <td>{{item.totalPayUserCount}}</td>
                                    <td>
                                        <a class="btn btn-sm btn-info" ui-sref="app.fullReductionEdit({id:item.id})" target="_blank">编辑</a>
                                        <button class="btn btn-sm btn-danger" ng-click="fullReductionDelete(item.id,item.name)">删除</button>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                            <div ng-if="list.length<=0 && !app.loading" class="padder-v text-center">
                                <span class="h6">~未搜索到任何数据~</span>
                            </div>
                            <div>
                                <circle-loading ng-if="app.loading"></circle-loading>
                            </div>
                        </div>
                    </div>
                </tab>
                <tab heading="进行中" ng-click="changeStatus(1)">
                    <div class="panel-body no-padder">
                        <div class="table-responsive pos-rlt">
                            <table class="table table-striped b-t b-light pos-rlt">
                                <thead>
                                <tr>
                                    <th>活动名称</th>
                                    <th>有限时间</th>
                                    <th>活动状态</th>
                                    <th>订单实付金额
                                        <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6"
                                           popover-placement="right" popover="满减送活动带来的总付款金额（包含退款）"
                                           popover-trigger="mouseenter"></i>
                                    </th>
                                    <th>付款订单数
                                        <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6"
                                           popover-placement="right" popover="参加满减送活动成功付款的订单数量"
                                           popover-trigger="mouseenter"></i>
                                    </th>
                                    <th>付款人数
                                        <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6"
                                           popover-placement="right" popover="参加满减送活动，成功付款的客户数"
                                           popover-trigger="mouseenter"></i>
                                    </th>
                                    <th width="200">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-if="list.length>0" ng-repeat="item in list" ng-init="initSelect()">
                                    <td>{{item.name}}</td>
                                    <td>{{item.startTime}}至{{item.endTime}}</td>
                                    <td>
                                        <span class="label bg-light dk"
                                              ng-class="{0:'bg-light',1:'bg-success',2:'bg-danger'}[item.status]"
                                              ng-bind="{0:'未开始',1:'进行中',2:'已结束'}[item.status]"></span>
                                    </td>
                                    <td>{{item.totalPayMoney}}</td>
                                    <td>{{item.totalOrdersCount}}</td>
                                    <td>{{item.totalPayUserCount}}</td>
                                    <td>
                                        <a class="btn btn-sm btn-info" ui-sref="app.fullReductionAdd({id:item.id})" target="_blank">编辑</a>
                                        <button class="btn btn-sm btn-danger" ng-click="fullReductionDelete(item.id,item.name)">删除</button>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                            <div ng-if="list.length<=0 && !app.loading" class="padder-v text-center">
                                <span class="h6">~未搜索到任何数据~</span>
                            </div>
                            <div>
                                <circle-loading ng-if="app.loading"></circle-loading>
                            </div>
                        </div>
                    </div>
                </tab>
                <tab heading="已结束" ng-click="changeStatus(2)">
                    <div class="panel-body no-padder">
                        <div class="table-responsive pos-rlt">
                            <table class="table table-striped b-t b-light pos-rlt">
                                <thead>
                                <tr>
                                    <th>活动名称</th>
                                    <th>有限时间</th>
                                    <th>活动状态</th>
                                    <th>订单实付金额
                                        <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6"
                                           popover-placement="right" popover="满减送活动带来的总付款金额（包含退款）"
                                           popover-trigger="mouseenter"></i>
                                    </th>
                                    <th>付款订单数
                                        <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6"
                                           popover-placement="right" popover="参加满减送活动成功付款的订单数量"
                                           popover-trigger="mouseenter"></i>
                                    </th>
                                    <th>付款人数
                                        <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6"
                                           popover-placement="right" popover="参加满减送活动，成功付款的客户数"
                                           popover-trigger="mouseenter"></i>
                                    </th>
                                    <th width="200">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-if="list.length>0" ng-repeat="item in list" ng-init="initSelect()">
                                    <td>{{item.name}}</td>
                                    <td>{{item.startTime}}至{{item.endTime}}</td>
                                    <td>
                                        <span class="label bg-light dk"
                                              ng-class="{0:'bg-light',1:'bg-success',2:'bg-danger'}[item.status]"
                                              ng-bind="{0:'未开始',1:'进行中',2:'已结束'}[item.status]"></span>
                                    </td>
                                    <td>{{item.totalPayMoney}}</td>
                                    <td>{{item.totalOrdersCount}}</td>
                                    <td>{{item.totalPayUserCount}}</td>
                                    <td>
                                        <a class="btn btn-sm btn-info" ui-sref="app.fullReductionAdd({id:item.id})" target="_blank">编辑</a>
                                        <button class="btn btn-sm btn-danger" ng-click="fullReductionDelete(item.id,item.name)">删除</button>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                            <div ng-if="list.length<=0 && !app.loading" class="padder-v text-center">
                                <span class="h6">~未搜索到任何数据~</span>
                            </div>
                            <div>
                                <circle-loading ng-if="app.loading"></circle-loading>
                            </div>
                        </div>
                    </div>
                </tab>
            </tabset>
            <footer class="panel-footer">
                <div class="row">
                    <div class="col-sm-offset-4 col-sm-4 text-center">
                        <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共
                            {{totalItems}} 项
                        </small>
                    </div>
                    <div class="col-sm-4 text-right text-center-xs">
                        <pagination boundary-links="true" total-items="totalItems" ng-model="currentPage"
                                    ng-change="pageChanged()" max-size="{{maxPageRow}}"
                                    class="pagination-sm m-t-none m-b"
                                    previous-text="上一页" next-text="下一页"
                                    first-text="首页" last-text="尾页"></pagination>
                    </div>
                </div>
            </footer>
        </div>
    </div>

</div>